import { defHttp } from '@/utils/http/axios';
import {
  chatidParams,
  deptListParams,
  deptUserListParams,
  integralListParams,
  rankingListParams,
} from './model/deptModel';
import { BasicListResult, BasicDataResult } from '../model/baseModel';

import { ErrorMessageMode } from '#/axios';

enum Api {
  //Login = '/login',
  getShop = '/jz/sys/shop/getShop',
  saveShop = '/jz/sys/shop/saveShop',
  areaList = '/jz/common/area/list',
  userLoginList = '/jz/sys/userManage/list',

  uploadChange = '/jz/file/uploadChange',
}

/**
 * @description: user login api
 */
export function getShopApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.getShop,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function saveShopApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.saveShop,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function areaListApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.areaList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function userLoginListApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.userLoginList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function uploadChangeApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.uploadChange,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
